#ifndef P2PVoice_COMMAND_IN_H_
#define P2PVoice_COMMAND_IN_H_
#include "command.h"

#pragma pack(1)
namespace Cmd
{
        namespace P2PVoice 
        {
                //  cmd declaration
                enum {
                        CMDIN_LOGIN             = 0x00B0,       // 其他服务器连接P2PVoiceServer验证
                        CMDIN_FUNC              = 0x00B1,	// 内部功能指令
                };
                enum { //CMDIN_LOGIN
                        SCMDIN_LOGIN                    = 0x0001,
                        SCMDIN_LOGIN_RESPONCE           = 0x0002,
                };
                enum { //CMDIN_FUNC
                        SCMDIN_CHANNEL_ID_REQ           = 0x0001,
                        SCMDIN_CHANNEL_ID_RES           = 0x0002,
                        SCMDIN_ADD_USER_REQ             = 0x0003,
                        SCMDIN_ADD_USER_RES             = 0x0004,
                        SCMDIN_DEL_CHANNEL              = 0x0005,
                };

                //	cmd definition
                struct stLoginCmd:t_NullCmd
                {
                        stLoginCmd():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN)
                        {
                                server_type_ = 0;
                                server_id_ = 0;
                                dest_type_ = P2PVOICESERVER;
                        }
                        WORD server_type_;
                        DWORD server_id_;
                        WORD dest_type_;
                };
                struct stLoginResponce:t_NullCmd
                {
                        stLoginResponce():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN_RESPONCE)
                        {
                        }
                };

                // cmd func
                struct stChannelIDReq:
                        t_NullCmd
                {
                        stChannelIDReq():
                                t_NullCmd(CMDIN_FUNC, SCMDIN_CHANNEL_ID_REQ)
                        {
                                requester_ = 0;
                                receiver_ = 0;
                        }
                        DWORD requester_;
                        DWORD receiver_;
                };
                struct stChannelIDRes:
                        t_NullCmd
                {
                        stChannelIDRes():
                                t_NullCmd(CMDIN_FUNC, SCMDIN_CHANNEL_ID_RES)
                        {
                                requester_ = 0;
                                receiver_ = 0;
                                channel_id_ = 0;
                        }
                        DWORD requester_;
                        DWORD receiver_;
                        DWORD channel_id_;
                };
                struct stAddUserReq:
                        t_NullCmd
                {
                        stAddUserReq():
                                t_NullCmd(CMDIN_FUNC, SCMDIN_ADD_USER_REQ)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                channel_id_ = 0;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        DWORD channel_id_;
                };
                struct stAddUserRes:
                        t_NullCmd
                {
                        stAddUserRes():
                                t_NullCmd(CMDIN_FUNC, SCMDIN_ADD_USER_RES)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                channel_id_ = 0;
                                ip_ = 0;
                                port_ = 0;
                                ret_code_ = 0;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        DWORD channel_id_;
                        DWORD ip_;
                        WORD  port_;
                        BYTE ret_code_; //0-fail 1-success
                };
                struct stDelChannel:
                        t_NullCmd
                {
                        stDelChannel():
                                t_NullCmd(CMDIN_FUNC, SCMDIN_DEL_CHANNEL)
                        {
                                channel_id_ = 0;
                                user_id_1_ = 0;
                                user_id_2_ = 0;
                        }
                        DWORD channel_id_;
                        DWORD user_id_1_;
                        DWORD user_id_2_;
                };

        }; //namespace P2PVoice
}; //namespace Cmd
#pragma pack() //pack(1)

#endif //P2PVoice_COMMAND_IN_H_
